<?php
namespace App\Http\Middleware;
use Closure;

/**
 * Class AdminLoginMiddleware
 * @package App\Http\Middleware
 */
class AdminLoginMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (session()->has('id'))
            return $next($request);
        return redirect('back/login');
    }
}
